module.exports = function ($stateProvider, $urlRouterProvider,$locationProvider,commonConfig) {
    // $locationProvider.hashPrefix('!#');
    $stateProvider
        .state('CloudPlatform', {  //云平台
            url: '/CloudPlatform',
            templateUrl: 'views/cloud/CloudPlatform.html',
            controller: require("./controller/cloud/CloudPlatformCtrl.js")
        })
        .state('login',{
            url:'/login',
            // templateUrl:'views/cloud/login.html',
            controller: require("./controller/cloud/LoginCtrl.js")
        })
        .state('CloudPlatform.ForgotPsw',{
            url:'/ForgotPsw',
            templateUrl:'views/cloud/ForgotPsw.html',
            controller: require("./controller/cloud/ForgotPswCtrl.js")
        })
        .state('CloudPlatform.FindPsw',{
            url:'/FindPsw',
            templateUrl:'views/cloud/FindPsw.html',
            controller: require("./controller/cloud/FindPswCtrl.js")
        })
        .state('CloudPlatform.home', {
            url: '/home',
            templateUrl: 'views/cloud/home.html',
            controller: require("./controller/cloud/HomeCtrl.js")
        })
        .state('CloudPlatform.RoleChoices',{
            url:'/RoleChoices',
            templateUrl:'views/register/RoleChoices.html', //TODO:预留接口
            // controller: require("./controller/register/RoleChoicesCtrl.js")
        })
        .state('CloudPlatform.TenantList', {
            url: '/TenantList',
            templateUrl: 'views/cloud/TenantList.html',
            controller: require("./controller/cloud/TenantListCtrl.js")
        })
        .state('CloudPlatform.TeacherRegister',{ //TODO:预留接口
            url:'/TeacherRegister',
            templateUrl:'views/register/TeacherRegister.html',
            // controller: require("./controller/register/RoleChoicesCtrl.js")
        })
///////////////////////////////////////////////////////////////////////////////////////////////////////
        .state('CloudPlatform.TenantRegister',{
            url:'/TenantRegister',
            templateUrl:'views/register/TenantRegister.html',
            controller: require("./controller/register/TenantRegisterCtrl.js")
        })
        .state('CloudPlatform.TenantRegisterResult',{
            url:'/TenantRegisterResult',
            templateUrl:'views/register/TenantRegisterResult.html',
            // controller: require("./controller/register/TenantRegisterCtrl.js")
        })
///////////////////////////////////////////////////////////////////////////////////////////////////////
        .state('CloudPlatform.App',{
            url:'/App',
            templateUrl:'views/AppCenter/App.html',
            controller: require("./controller/App/AppCtrl")
        })
        .state('CloudPlatform.App.Home',{
            url:'/Home',
            templateUrl:'views/AppCenter/AppHome.html',
            controller: require("./controller/App/AppHomeCtrl")
        })
        .state('CloudPlatform.App.Detail',{
            url:'/Detail/:id',
            templateUrl:'views/AppCenter/AppDetail.html',
            controller: require("./controller/App/AppDetailCtrl")
        })
        .state('CloudPlatform.App.Type',{
            url:'/Type/:id',
            templateUrl:'views/AppCenter/AppType.html',
            controller: require("./controller/App/AppTypeCtrl")
        })
        //云平台租户管理员
        // .state('TenantManager',{
        //     url:'/TenantManager',
        //     templateUrl:'views/cloud/TenantManager/TenantManager.html',
        //     controller: require("./controller/cloud/CloudUser/CloudUserFrameCtrl.js")
        // })
        // .state('TenantManager.BaseInfo',{
        //     url:'/BaseInfo',
        //     templateUrl:'views/cloud/TenantManager/BaseInfo.html',
        //     controller:require("./controller/cloud/TenantManager/BaseInfoCtrl")
        // })
        //
        // .state('TenantManager.App',{
        //     url:'/App',
        //     templateUrl:'views/AppCenter/App.html',
        //     controller: require("./controller/App/AppCtrl")
        // })
        // .state('TenantManager.App.Detail',{
        //     url:'/Detail/:id',
        //     templateUrl:'views/AppCenter/AppDetail.html',
        //     controller: require("./controller/App/AppDetailCtrl")
        // })
        // .state('TenantManager.App.Type',{
        //     url:'/Type/:id',
        //     templateUrl:'views/AppCenter/AppType.html',
        //     controller: require("./controller/App/AppTypeCtrl")
        // })

        //云平台普通用户（管理员、老师、学生）
        .state('CloudUser',{  //应用列表框架
            url:'/CloudUser',
            templateUrl:'views/cloud/CloudUser/CloudUserFrame.html',
            controller: require("./controller/cloud/CloudUser/CloudUserFrameCtrl.js")
        })
        .state('CloudUser.AppMain',{ //普通用户登录后页面
            url:'/AppMain',
            templateUrl:'views/cloud/CloudUser/AppMain.html',
            controller: require("./controller/cloud/CloudUser/AppMainCtrl.js")
        })
        // //学校管理员
        // .state('SchoolManager',{
        //     url:'/SchoolManager',
        //     templateUrl:'views/cloud/SchoolManager/SchoolManager.html',
        //     controller: require("./controller/cloud/CloudUser/CloudUserFrameCtrl.js")
        // })
        // .state('SchoolManager.BaseInfo',{
        //     url:'/BaseInfo',
        //     templateUrl:'views/cloud/SchoolManager/BaseInfo.html',
        //     controller:require("./controller/cloud/SchoolManager/BaseInfoCtrl")
        // })
        // .state('SchoolManager.UserCenter',{
        //     url:'/UserCenter',
        //     templateUrl:'views/cloud/SchoolManager/UserCenter.html',
        //     controller:require("./controller/cloud/SchoolManager/UserCenterCtrl")
        // })
        // .state('SchoolManager.AppsIndex',{
        //     url:'/AppsIndex',
        //     templateUrl:'views/cloud/SchoolManager/AppsManager/AppsIndex.html'
        // })
        // .state('SchoolManager.AppsIndex.Apps',{
        //     url:'/Apps',
        //     templateUrl:'views/cloud/SchoolManager/AppsManager/Apps.html',
        //     controller: require("./controller/cloud/SchoolManager/AppsManager/AppsCtrl.js")
        // })
        // .state('SchoolManager.AppsIndex.AppsRole',{
        //     url:'/AppsRole',
        //     templateUrl:'views/cloud/SchoolManager/AppsManager/AppsRole.html',
        //     controller: require("./controller/cloud/SchoolManager/AppsManager/AppsRoleCtrl.js")
        // })
        // .state('SchoolManager.AppsRoleEdit',{
        //     url:'/AppsRoleEdit/:id',
        //     templateUrl:'views/cloud/SchoolManager/AppsManager/AppsRoleEdit.html',
        //     controller: require("./controller/cloud/SchoolManager/AppsManager/AppsRoleEditCtrl.js")
        // })
        // .state('SchoolManager.User',{
        //     url:'/User',
        //     templateUrl:'views/cloud/SchoolManager/UserManager/User.html',
        //     controller: require("./controller/cloud/SchoolManager/UserManager/UserCtrl.js")
        // })
        // .state('SchoolManager.UserEdit',{
        //     url:'/UserEdit/:id',
        //     templateUrl:'views/cloud/SchoolManager/UserManager/UserEdit.html',
        //     controller: require("./controller/cloud/SchoolManager/UserManager/UserEditCtrl.js")
        // })
        // .state('SchoolManager.Role',{  //TODO:预留接口
        //     url:'/Role',
        //     templateUrl:'views/cloud/SchoolManager/RoleManager/Role.html',
        //     controller: require("./controller/cloud/SchoolManager/RoleManager/RoleCtrl.js")
        // })
///////////////////////////////////////////////////////////////////////////////////////////////////////
        .state('DeveloperIndex', {  //开发者平台
            url: '/DeveloperIndex',
            templateUrl: 'views/DeveloperPlatform/DeveloperIndex.html',
            controller: require("./controller/cloud/CloudPlatformCtrl.js")
        })
        // .state('DeveloperLogin',{  //去除显示页面，只做中间跳转
        //     url:'/DeveloperLogin',
        //     // templateUrl:'views/DeveloperPlatform/DeveloperLogin.html',
        //     controller: require("./controller/DeveloperPlatform/DeveloperLoginCtrl.js")
        // })
        .state('DeveloperIndex.Home', {
            url: '/DeveloperHome',
            templateUrl: 'views/DeveloperPlatform/DeveloperHome.html',
            controller: require("./controller/DeveloperPlatform/DeveloperHomeCtrl.js")
        })
        .state('DeveloperIndex.Register',{
            url:'/DeveloperRegister',
            templateUrl:'views/DeveloperPlatform/DeveloperRegister.html',
            controller: require("./controller/DeveloperPlatform/DeveloperRegisterCtrl.js")
        })
        .state('DeveloperIndex.RegisterResult',{
            url:'/DeveloperRegisterResult',
            templateUrl:'views/DeveloperPlatform/DeveloperRegisterResult.html',
            controller: require("./controller/DeveloperPlatform/DeveloperRegisterResultCtrl.js")
        })
        .state('DeveloperIndex.FindPsw',{
            url:'/DeveloperFindPsw',
            templateUrl:'views/DeveloperPlatform/DeveloperFindPsw.html',
            controller: require("./controller/DeveloperPlatform/DeveloperFindPswCtrl.js")
        })
        .state('DeveloperIndex.WikiList',{
            url:'/WikiList',
            templateUrl:'views/wiki/WikiList.html',
            controller: require("./controller/wiki/WikiListCtrl.js")
        })
        .state('DeveloperMain',{
            url:'/DeveloperMain',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperMain.html',
            controller: require("./controller/DeveloperPlatform/DeveloperUser/DeveloperMainCtrl.js")
        })
        .state('DeveloperMain.DeveloperBaseInfo',{
            url:'/DeveloperBaseInfo',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperBaseInfo.html',
            controller: require("./controller/DeveloperPlatform/DeveloperUser/DeveloperBaseInfoCtrl")
        })
        .state('DeveloperMain.DeveloperCompleteInfo',{
            url:'/DeveloperCompleteInfo',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperCompleteInfo.html',
            controller: require("./controller/DeveloperPlatform/DeveloperUser/DeveloperCompleteInfoCtrl.js")
        })
        .state('DeveloperMain.frame',{
            url:'/frame',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperApps/frame.html'
        })
        .state('DeveloperMain.frame.DeveloperApps',{
            url:'/DeveloperApps',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperApps/DeveloperApps.html',
            controller: require("./controller/DeveloperPlatform/DeveloperUser/DeveloperApps/DeveloperAppsCtrl")
        })
        .state('DeveloperMain.frame.DeveloperAppBanner',{
            url:'/DeveloperAppBanner/:id',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperApps/DeveloperAppBanner.html',
            controller: require("./controller/DeveloperPlatform/DeveloperUser/DeveloperApps/DeveloperAppBannerCtrl")
        })
        .state('DeveloperMain.frame.CommonApps',{
            url:'/CommonApps/:id',
            templateUrl:'views/DeveloperPlatform/DeveloperUser/DeveloperApps/CommonApps.html',
            controller: require("./controller/DeveloperPlatform/DeveloperUser/DeveloperApps/CommonAppsCtrl")
        })
        .state('DeveloperManager',{
            url:'/DeveloperManager',
            templateUrl:'views/DeveloperPlatform/ManagerUser/DeveloperManager.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/DeveloperManagerCtrl")
        })
        .state('DeveloperManager.ManagerBaseInfo',{
            url:'/ManagerBaseInfo',
            templateUrl:'views/DeveloperPlatform/ManagerUser/ManagerBaseInfo.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/ManagerBaseInfoCtrl.js")
        })
        .state('DeveloperManager.AppsManage', {
            url: '/AppsManage',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/AppsManage/AppsIndex.html'
        })
        .state('DeveloperManager.AppsManage.Unapproved', {
            url: '/Unapproved',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/AppsManage/Unapproved.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/AppsManage/UnapprovedCtrl.js")
        })
        .state('DeveloperManager.AppsManage.Pass', {
            url: '/Pass',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/AppsManage/Pass.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/AppsManage/PassCtrl.js")
        })
        .state('DeveloperManager.AppsManage.NotPass', {
            url: '/NotPass',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/AppsManage/NotPass.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/AppsManage/NotPassCtrl.js")
        })

        .state('DeveloperManager.TenantManage', {
            url: '/TenantManage',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/TenantManage/TenantIndex.html'
        })
        .state('DeveloperManager.TenantManage.Unapproved', {
            url: '/Unapproved',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/TenantManage/Unapproved.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/TenantManage/UnapprovedCtrl.js")
        })
        .state('DeveloperManager.TenantManage.Pass', {
            url: '/Pass',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/TenantManage/Pass.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/TenantManage/PassCtrl.js")
        })
        .state('DeveloperManager.TenantManage.NotPass', {
            url: '/NotPass',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/TenantManage/NotPass.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/TenantManage/NotPassCtrl.js")
        })

        .state('DeveloperManager.DeveloperManage', {
            url: '/DeveloperManage',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/DeveloperManage/DeveloperIndex.html'
        })
        .state('DeveloperManager.DeveloperManage.Unapproved', {
            url: '/Unapproved',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/DeveloperManage/Unapproved.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/DeveloperManage/UnapprovedCtrl.js")
        })
        .state('DeveloperManager.DeveloperManage.Pass', {
            url: '/Pass',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/DeveloperManage/Pass.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/DeveloperManage/PassCtrl.js")
        })
        .state('DeveloperManager.DeveloperManage.NotPass', {
            url: '/NotPass',
            templateUrl: 'views/DeveloperPlatform/ManagerUser/DeveloperManage/NotPass.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/DeveloperManage/NotPassCtrl.js")
        })
        .state('DeveloperManager.HelpManage',{
            url:'/HelpManage',
            templateUrl:'views/DeveloperPlatform/ManagerUser/HelpManage/HelpManage.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/HelpManage/HelpManageCtrl.js")
        })
        .state('DeveloperManager.InterfaceManage',{
            url:'/InterfaceManage',
            templateUrl:'views/DeveloperPlatform/ManagerUser/InterfaceManage/Interface.html',
            controller: require("./controller/DeveloperPlatform/ManagerUser/InterfaceManage/InterfaceCtrl.js")
        })
///////////////////////////////////////////////////////////////////////////////////////////////////////

        .state('wikiIndex',{  //没用到
            url:'/wikiIndex',
            templateUrl:'views/wiki/WikiIndex.html',
            //controller: require("./controller/wiki/WikiListCtrl.js")
        })
        // .state('DeveloperIndex.WikiList',{
        //     url:'/WikiList',
        //     templateUrl:'views/wiki/WikiList.html',
        //     controller: require("./controller/wiki/WikiListCtrl.js")
        // })
        .state('DeveloperMain.Wiki', {//没用到
            url: '/Wiki',
            templateUrl: 'views/wiki/Wiki.html',
            controller: require("./controller/wiki/WikiCtrl.js")
        })
        .state('DeveloperMain.Edit',{//没用到
            url:'/Edit/:id',
            templateUrl:'views/wiki/Edit.html',
            controller: require("./controller/wiki/WikiEditCtrl.js")
        })

    ;
    //$urlRouterProvider.when("", "/CloudPlatform/home");
    if(commonConfig.version === 'noAdvertising'){
        $urlRouterProvider.otherwise('/login');   //TODO 跳过广告页
    }else {
        $urlRouterProvider.otherwise('/CloudPlatform/home'); // 广告页面
    }
    // $locationProvider.html5Mode(true);
};